@extends('layouts.admin')
@section('title') @parent 修改文章 @stop
@section('page_title')@parent
修改文章
@show
@section('breadcrumb')@parent
{{ Breadcrumbs::render('article-edit') }}
@show
@section('content')
<div class="row">
		@include('widgets.notification')
		<div class="col-md-12">
				<!-- general form elements -->
				<div class="box box-primary">
						<div class="box-header">
								<h3 class="box-title">修改文章</h3>
						</div>
						<form for="form" class="" autocomplete="off" method="post" action="{{ route('admin.article.update', $article->id) }}" enctype="multipart/form-data" id="form-coupon">
						<input type="hidden" name="_token" value="{{ csrf_token() }}" />
						<div class="box-body">
								<div class="form-group">
										<label for="class">文章类型</label>
										{{ $article->class }}
								</div>
								<div class="form-group" style="@if($article->down_group)display:block; @else display:none; @endif" id="down">
										<label for="class">下载类型</label>
										{{ $article->down_group }}
								</div>
								<div class="form-group">
										<label for="class">法律类型</label>
										{{ $article->law_cat }}
								</div>
								<div class="form-group">
										<label for="title">文章标题</label>
										@if(Input::old('title')){{ Input::old('article_title') }}@else{{ $article->title }}@endif
								</div>
								<div class="form-group">
										<label for="keys">关键字</label>
										@if(Input::old('keys')){{ Input::old('keys') }}@else{{ $article->keys }}@endif
								</div>
								<div class="form-group">
										<label for="info">文章简介</label>
										@if(Input::old('info')){{ Input::old('info') }}@else{{ $article->info }}@endif
								</div>
								<div class="form-group">
										<label for="content">文章内容</label>
										@if(Input::old('content')){{ Input::old('content') }}@else{{ $article->articleContent() }}@endif
								</div>
								<div class="form-group">
										<label>缩略图</label>
										@if($article->img)<img src="{{ Config::get('app.url') }}/{{ $article->img }}" style="width:200px;">@endif
								</div>
								<div class="form-group">
										<label>下载文件</label>
										@if($article->file_path)<a href="{{ Config::get('app.url') }}/{{ $article->file_path }}">下载文件</a>@endif
								</div>								
						</div>
						<div class="box-footer">
								<a href="{{ route('admin.article.from_lawyer.index') }}" class="btn btn-default btn-save">返 回</a>
								@if(!$article->status)
									<a href="#" type="button" class="btn btn-primary btn-approve">审核通过</a>
									<a href="#" type="button" class="btn btn-primary btn-unapprove">审核不通过</a>
								@endif
						</div>
						</form>
				</div>
		</div>
</div>
@stop
@section('end')
    @parent
{{ HTML::script("/js/jquery-ui-1.11.1.min.js") }}
<script>
$(function() {
	$(".btn-approve").click(function(){
		if(confirm("确认这篇文章通过审核？"))
		{
				location.href="{{ route('admin.article.approve', $article->id) }}";
		}
	});
	$(".btn-unapprove").click(function(){
		if(confirm("确认这篇文章不能通过审核？"))
		{
				location.href="{{ route('admin.article.unapprove', $article->id) }}";
		}
	})
});
</script>
@stop